var t = function(t) {
    return t && t.__esModule ? t : {
        default: t
    };
}(require("../../utils/event-emitter")), e = {
    CHAT: "chat",
    CHATING: "chating"
}, a = !1;

Component({
    properties: {
        control: {
            type: Boolean,
            value: !1,
            observer: "_topTipAnimate"
        },
        duration: {
            type: Number,
            value: 2e3
        },
        content: Object,
        tipType: {
            type: String,
            value: ""
        },
        chatid: String,
        origin: String
    },
    ready: function() {
        t.default.addListener("radar.message.socket", this.event);
    },
    detached: function() {
        t.default.removeListener("radar.message.socket", this.event);
    },
    methods: {
        _topTipAnimate: function(t) {
            var e = this;
            t && setTimeout(function() {
                e.setData({
                    control: !t
                });
            }, this.data.duration);
        },
        _onTap: function() {
            switch (this.data.tipType) {
              case e.CHAT:
                wx.navigateTo({
                    url: "/publicPackage/salesradar/withinmsg/withinmsg"
                });
                break;

              case e.CHATING:
                wx.navigateBack({
                    delta: 1
                });
            }
        },
        marketRadarChat: function(t) {
            var e = t.issystem, i = (t.avatar, t.content.content, t.chatid);
            +e || this.data.chatid && this.data.chatid === i || a || (a = !0, wx.showModal({
                content: "你有新的未读消息",
                confirmText: "去看看",
                success: function(t) {
                    t.confirm && wx.navigateTo({
                        url: "/publicPackage/salesradar/withinmsg/withinmsg"
                    });
                },
                complete: function() {
                    return a = !1;
                }
            }));
        }
    }
});